import requests

# 登录链接
url_login = 'https://login2.scrape.center/login'
data = {'username': 'admin',
        'password': 'admin'}
head = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0'
}
# 发送请求，模拟登录
login_response = requests.post(url_login, data=data)
# 寻找cookie
cookies = login_response.history[0].cookies

# 第二页电影信息
url2 = 'https://login2.scrape.center/page/2'
# 第二次请求时，带上cookie，服务器就可以识别到已登录
page2 = requests.get(url2, cookies=cookies)
print(page2.text)